<h1>車輌情報</h1>
<table border="1" cellspacing=0 id="order_info">
  <tr>
    <th>標識番号 </th>
    <td><%= @order.recipe_name%></td>
    <th>サイズ </th>
    <td><%= @order.car_size%></td>
  </tr>
  <tr>
    <th>車種 </th>
    <td><%= @order.car_type%></td>
    <th>塗装種類 </th>
    <td><%= @order.paint_type%></td>
  </tr>
  <tr>
  	<th>修正機</th>
	<% if @order.use_amend_set%>
		<td id="use_amend_set">使用<td>
	<%else%>
		<td id="use_amend_set">使用しない<td>
	<%end%>
  </tr>
<td colspan="1"><br/></td>
</table>
<h1>損傷情報</h1>

	 	<table class="car_info" cellspacing=0 border=1>
  		<tr>
    		<th class="title_in_car">衝撃角度</th>
			<th class="title_in_car">部位</th>
			<th class="title_in_car">作業</th>
  		</tr>
 		 <tr>
			<td class="no_bottom_line" id="direction"></td>
			<td class="no_bottom_line" id="position"></td>
			<td class="no_bottom_line" id="work"></td>
  		</tr>
		</table>
<div id="section_line"></div>
		<% a= 0 %>
<% form_tag(url_for_optioins = {:action => :save_inside_position},options = {:id => "inside_position_form",:name=>'frm'}) do%>
	<% @direction_sides.each do |direction_side|%>
		<div id="item_title">●外板情報&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                		     ◈衝撃角度 ： <%= direction_side%>&nbsp;&nbsp;&nbsp;
		
                ◈部位：<%= @positions_in_direction_side["#{direction_side}"]%></div>
		<%@inside_positions_in_direction_side["#{direction_side}"].each do |item|%>
		<% chkId=0 %>
	</p><%= check_box_tag 'inside_position',item.id ,false,:onclick => "selOneChkbox('#{item.id}');"%><%= item.part %>
		<%end%>
	<%end%>
<div id="section_line"></div>
<div id="item_title">作業を選択:</div>
<%= radio_button_tag 'work', '修正'%>修正
<%= radio_button_tag 'work', '取替'%>取替
<div id="section_line"></div>
<div id="back_forward">
<a href="javascript:history.back(-1)"><img src="/images/btn_back_01.gif" class="back"></a>
<%= image_submit_tag("btn_next_01.gif",:onclick => "return verify();")%>
</div>
<%end%>

<script type="text/javascript">
	function selOneChkbox(value){
		var chkboxObj = document.inside_position_form.inside_position
		var length = chkboxObj.length
		var i
		for(i=0;i<length;i++){
			chkboxObj[i].checked = false;
			if(chkboxObj[i].value == value){chkboxObj[i].checked = true;}	
		}
	}

	function verify() {
		inside_position = document.getElementsByName("inside_position");
		inside_position_no_select = true;
		work1 = document.getElementById("work_修正")
		work2 = document.getElementById("work_取替")
		work_no_select = true;
		for(var i = 0; i < inside_position.length; i++) {
			if (inside_position[i].checked == true) {
				inside_position_no_select = false;
				break;
			}
		}
		if(inside_position_no_select) {
			alert("部位を選んでください");
			return false;
		}
		if(work1.checked || work2.checked)
			work_no_select = false;
		if(work_no_select) {
			alert("作業を選んでください");
			return false;
		}
		return true
	}
</script>


<%= observe_form :inside_position_form,
				 :frequency => 0.2,
				 :url => {:action => :check_position }%>




